import numpy as np
from problems.coco_benchmark import CocoBenchmark

def main():
    # 设置问题维度
    dim = 2
    
    # 获取问题信息
    lower_bounds, upper_bounds, optimal_solution = CocoBenchmark.get_problem_info(dim)
    print(f"问题维度: {dim}")
    print(f"下界: {lower_bounds}")
    print(f"上界: {upper_bounds}")
    print(f"最优解: {optimal_solution}")
    
    # 测试点
    test_point = np.array([1.0, 1.0])
    
    # 测试所有函数
    functions = ['sphere', 'rastrigin', 'rosenbrock', 'ellipsoidal', 'weierstrass', 'schwefel']
    
    print("\n测试结果:")
    for func_name in functions:
        result = CocoBenchmark.evaluate(test_point, func_name)
        print(f"{func_name}: {result}")

if __name__ == "__main__":
    main() 